# OpenAPI version identifier - required for OpenAPI 3.0 domains
# (c) Elexon 2022, 2023
#
# MMHS - Data Integration Platform 
# SubmitEvents API 
#
# ----- update notices ---------------------------------------------------------------
# December 2023
# --------------
## Version 1.5.2 available for pre-release assessment
##
# October 2023
# --------------
# Updates to include changes for interim release 1.5.1
# Changes to implement inconsistencies highlighted by internal audit. NO structural change to 
# any objects. Changes to event codes and optionality of properties within objects
#
# September 2023
# --------------
# Updates to include changes for interim release 1.5
# - see below for details
#
# August 2023
# -----------
# Updates to include changes for interim release 1.4
#
# July 2023
# ---------
# Updates to include changes for interim release 1.3
#
# April 2023
# ----------------
# Version 1.1 is now published and fixed. 
# A version 1.2 will be created to pick up the next set of changes. 
#
# ----- note on use of upper/lower case -------------------------------------
# DIP will be enforcing capitalisation validation on JSON field names to align with Open API standards
#   
# January 2023
# ------------
# After consulation with the DIP SP there has been a significant change to the endpoint definitions for the submisison of messages
# Instead of a single endpoint where all messages are submitted, each message interface will be submitted at a different endpoint 
# The rationale for this chnage is primarily from a maintainability point-of-view as it allows maintainence on each interface in isolation from 
# other interfaces and allows new message channels to be added without impact existing interfaces. 
#
# outstanding work :-
# 1. replace swaggerhub domain with DIP domain name - to do
#
# none of these items affect the data format
# 
# any comments please relay to design(@)mhhsprogramme.co.uk
# ------------------------------------------------------------------------------------
# Change history
# ====================================================================================
# Ver   Date           Ref.    Description
# ------------------------------------------------------------------------------------
# 1.5.2 30/11/2023   DIN-784    DIPMessage.payload add as a required property
#                    DIN-798    Removal of comment for relaxing capitalisation checks
# 1.5.1 6 Oct 23                Update links to examples 0.3
#       9 oct 23     DIN 700    Remove recipent id from MessageRequest as already specified on path
# 1.5 - Sept 23                 Significant updates including:
#                    DIN 602    Update to multiple interfaces to include IF variants 
#                               with muliple event codes and block population   
#                    DIN 650    Compressed payloads for ECS reports
#                               Inclusion of a Examples module so that some example messages 
#                               have been inlcuded in the drop-down from the /dip-channel/{id}
#                               definition
#                               Other minor DINS to tidy up interface and report definitions
#
# 1.4 - August 23               Include REP900/901 for CR27 - DUoS E-Billing DIP message for MHHS
#       July 2023    DIN 485    Issue with requirng a recipient ID for many Post/Delete 
#                               operations so that the subject is known, need to specify 
#                               which webhook is being deleted, and post methods for webhook config, 
#                               post methods for replay
# 1.3 - June 2023               Interim release 3 support
#                    DIN-463    Add de-register of Status Message API 
#                    DIN-464    Add enumeration for message channels  
# 1.2 - May 2023                Add replay API 
# 1.1 - Feb/Mar 23              Message signatures in headers
#                               Multiple endpoints with reworked API calls 
#                               Introduced a standard response for messages response and Status Message
#                               URLs adopy standardisation of lower case and case insensitivity
# 1.0 - 17/02/2023              Published to align with DAG sign-off 16/02/23
# 0.4 - 26/01/2023   
# 0.3 - 10/11/2022              Align with component files which are all 0.3
#       18/11/2022              Mulitple updates to REPs
#       21/11/2022              Add IF-050
#       19/12/2022              Add IF-019 & IF-020, IF-004. Other interfaces tidy up    
#
# 0.2 - Sept/Oct 22             Updates following first MHHS Programme review - multiple updates
#                                 - industry comments 
#                                 - API security schema 
#                                 - webhook subscription takkes parameters of Publication Ids 
#
## 0.1 - August 22              Sent for first MHHS Programme Review
# ==============================================================
# 



openapi: 3.0.0
info:
  version: 1.5.2
  title: DIP - Send Messages & Receive Publications
  description: DIP APIs for sending & recieving MHHS TOM messages and reports. <br>Supported interfaces -<br><br>
     -           Channel-001    Notification of Change of Supplier **<br>
     -           Channel-002    Registration Update to Supplier (COS Gain) **<br>
     -           Channel-003    Notification of Migration and De-Appointment (Migration)<br>
     -           Channel-004    Comms Hub Information <br>
     -           Channel-005    Metering Service MTD Updates to Registration<br>
     -           Channel-006    Registration Service Notification of MTD Updates<br>
     -           Channel-007    Change of Energisation Status Outcome<br>
     -           Channel-008    Registration Service Notification of Change of Energisation Status<br>
     -           Channel-009    Registration Service Notification of Disconnection<br>
     -           Channel-013    MDS Defaults Applied <br>
     -           Channel-014    Rejected Consumption Data Submission<br>
     -           Channel-015    Request Historic Consumption Replay (ADV Sites only)<br>
     -           Channel-016    HH Consumption History Replay  (ADV Sites only)<br>
     -           Channel-018    Notification of Registration Data Item Changes<br>
     -           Channel-019    Maintain MPAN Relationships<br>
     -           Channel-020    Maintain MPAN Relationship Response<br>
     -           Channel-021    UTC Settlement Period Consumption Data<br>
     -           Channel-022    LSS Period Data<br>
     -           Channel-023    LSS Totals Data<br>
     -           Channel-024    Supplier Advisory Notification to DS<br>
     -           Channel-025    Supplier Updates to Registration<br>
     -           Channel-026    Registration Service Notification of Supplier Data Chg<br>
     -           Channel-027    Consumption Amendment Request<br>
     -           Channel-028    Consumption Amendment Request Response<br>
     -           Channel-030    Correlated MPAN Activity<br>
     -           Channel-031    Supplier Service Provider Appointment Request<br>
     -           Channel-032    Supplier Service Provider Appointment Request Response<br>
     -           Channel-033    Registration Service Request for Service Appointment<br>
     -           Channel-034    Service Provider Appointment Request Response<br>
     -           Channel-035    Registration Service Appointment Status Notification<br>
     -           Channel-036    Registration Service Notification of Service Appointment & Supporting Info<br>
     -           Channel-037    Registration Service Notification of Service De-Appointment<br>
     -           Channel-038    Customer Direct Contract Advisory<br>
     -           Channel-039    Customer Direct Contract Advisory Response<br>
     -           Channel-040    Notification of ECS Annual Consumption<br>
     -           Channel-041    Cumulative Meter Reading<br>
     -           Channel-042    Customer Name Information<br>
     -           Channel-043    Registration Service Notification of Change of Connection Type<br>
     -           Channel-044    Registration Service Notification of Change of Segment<br>
     -           Channel-045    Registration Service Notification of Invalid Segment or No Agents Appointed<br>
     -           Channel-047    Notification of the Publication of a Downloadable Asset<br>
     -           Channel-050    EES Exclusive Updates<br><br>
     **ECS Reports**<br><br>
     -           REP-002   LDSO report for DUoS (LDSO) – aggregated data **<br>
     -           REP-002A  Embedded Network report for DUoS – aggregated data<br>
     -           REP-002B  LDSO report for DUoS (Supplier)– aggregated data<br>
     -           REP-003   BM Unit Allocated Demand Volumes to Market Participants<br>
     -           REP-004   Supplier Deemed Take Report<br>
     -           REP-006   Aggregated Uncorrected volumes by CCC to Market Participants<br>
     -           REP-007   VAS Exception Report to Suppliers and BSCCo<br>
     -           REP-008   MDS Exception Report to LDSOs<br>
     -           REP-009   EMRS Report for Suppliers<br><br>
     New reports introduced for e-billing of site-specific DUoS <br><br>
     -           REP-900   LDSO E-bill Distribution Invoice I<br>
     -           REP-901   LDSO E-bill Distribution Invoice II<br>
     <br>
     ** examples available in post /dip-channel/{id}<br>  
     any comments please relay to design@mhhsprogramme.co.uk
servers:

  # Added by API Auto Mocking Plugin
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/MHHSPROGRAMME/SubmitEvents/1.5.2
  - description: SwaggerHub API Mock Server
    url: https://virtserver.swaggerhub.com/MHHSPROGRAMME/submitMessages/1.1

  # Apply the API key globally to all operations    
security:
  - ApiKeyAuth: []



paths:
  /dip-channel/{id}:
    summary: DIP Interface Channels
    description: Represents a single DIP messaging channel. Each interface/publication/report is identified by a 'id'
        
    post:
      summary: Submit a series of Interface messages 
      description: Allows a Market Participant to submit a series of messages on a DIP interface 
      operationId: sendMessage
      tags:
          - DIP Message Channel
      parameters:
        - $ref: '#/components/parameters/MessageChannel'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'

        
      requestBody:
        required: true
        content:
          application/json:
            schema:
                $ref: '#/components/schemas/DIPMessageArray'
            examples:
              IF-001:
                $ref:  'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Examples/0.3#/components/examples/IF-001'
              IF-002:
                $ref:  'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Examples/0.3#/components/examples/IF-002'
              REP-002:
                $ref:  'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Examples/0.3#/components/examples/REP-002'


      responses:
        '201':
          description: Messages created
          content: 
            application/json:
              schema:
                  $ref: '#/components/schemas/StandardResponse'
                
        '207':
          description: Some messages created
          content: 
            application/json:
              schema:
                  $ref: '#/components/schemas/StandardResponse'
                  
        '400':
          description: Bad Request
        '401':
          description: Unauthorised Error            
        '403':
          description: Forbidden
        '404':
          description: Not found
        '405': 
          description: Method Not Allowed
        '406': 
          description: Not Acceptable
        '408':
          description: Request Timeout
        '413': 
          description: Payload Too Large
        '429':
          description: Too Many Requests
          
        '500':
          description: Internal Server Error
        '502': 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504': 
          description: Gateway Timeout
        '505':
          description: HTTP Version Not Supported
          
         # 
           
      
  /dip-channel/{id}/pubconfig/{recipient-id}:
    post:
      summary: Configure DIP Channel Publication  
      description: Allows a Market Participant to configure the output channel 
      operationId: configurePublication 
      tags:  
          - DIP Channel Publication Configuration 
      parameters:
        - $ref: '#/components/parameters/MessageChannel'
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'

      requestBody:
        required: true
        content:
          application/json:
            schema:
                $ref: '#/components/schemas/WebhookConfig'
                
      callbacks:
        outEvent:
          '{$request.body#/config.callbackURL}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                        $ref: '#/components/schemas/DIPMessageArray'
          
              responses:
                '200':
                  description: OK
                  content: 
                    application/json:
                      schema:
                        $ref: '#/components/schemas/StandardResponse'
                  
                '207':
                  description: Some messages accpeted
                  content: 
                    application/json:
                      schema:
                        $ref: '#/components/schemas/StandardResponse'

      responses:
        '201':
            description: Publication configured 
        '400':
            description: Bad Request
        '401':
            description: Unauthorised Error            
        '403':
            description: Forbidden
            
    delete:
      summary: Delete existing Publication configuration 
      description: Delete an exisiting webhook for PUB-001 publication
      tags:
          - DIP Channel Publication Configuration 
      parameters:
        - $ref: '#/components/parameters/MessageChannel'
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'

      responses:
        '204':
            description: Publication config deleted
        '401':
            description: Unauthorised Error            

### replay still in development

  /dip-channel/{id}/replay/{recipient-id}:
    post:
      summary: Replay messages from a DIP Channel Publication  
      description: Allows a Market Participant to replay messages  
      operationId: replayPublication
      tags: 
          - DIP Channel Replay/Requeue
      parameters:
        - $ref: '#/components/parameters/MessageChannel'
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'

      requestBody:
        required: true
        content:
          application/json:
            schema:
                $ref: '#/components/schemas/MessageRequest'
                

      responses:
        '200':
          description: Replayed Messages 
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/DIPMessageArray'

        '400':
            description: Bad Request
        '401':
            description: Unauthorised Error            
        '403':
            description: Forbidden

  /dip-channel/{id}/requeue/{recipient-id}:
    post:
      summary: Requeue messages on DIP Channel webhook  
      description: Allows a Market Participant to replay messages  
      operationId: requeuePublication
      tags: 
          - DIP Channel Replay/Requeue
      parameters:
        - $ref: '#/components/parameters/MessageChannel'
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'

      requestBody:
        required: true
        content:
          application/json:
            schema:
                $ref: '#/components/schemas/MessageRequest'
                
      responses:
        '200':
          description: Messages requeued

        '400':
            description: Bad Request
        '401':
            description: Unauthorised Error            
        '403':
            description: Forbidden

  /statusmessage: 
    post:
      summary: Submit a series of status messages
      description: Allows a Market Participant to submit a series of status messages 
      operationId: submitStatusMessage
      tags: 
        - Status Messages
      parameters:
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'


      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StandardResponseArray'

      responses:
        '201':
          description: Created
          content: 
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'

        '400':
          description: Bad Request
        '401':
          description: Unauthorised Error            
        '403':
          description: Forbidden
        '404':
          description: Not found
        '405': 
          description: Method Not Allowed
        '406': 
          description: Not Acceptable
        '408':
          description: Request Timeout
        '413': 
          description: Payload Too Large
        '429':
          description: Too Many Requests
          
        '500':
          description: Internal Server Error
        '502': 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504': 
          description: Gateway Timeout
        '505':
          description: HTTP Version Not Supported


  /statusmessage/config/{recipient-id}:
    parameters:
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'
    post:
      summary: Webhook to pull a series of status messages
      description: Allows a Market Participant to get a series of status messages 
      operationId: postStatusMsgWebhook
      tags: 
        - Status Messages
      
      requestBody:
        required: true
        content:
          application/json:
            schema:
                $ref: '#/components/schemas/WebhookConfig'
      
      responses:
        '201':
          description: Webhook created
          
        '401':
            description: Unauthorised Error            

        
      callbacks:
        outEvent:
          '{$request.body#/callbackURL}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                        $ref: '#/components/schemas/StandardResponseArray'
              responses:
                '200':
                  description: OK

    delete:
      summary: Delete existing Status Message configuration 
      description: Delete an exisiting webhook for Status Messages 
      tags:
        - Status Messages
      parameters:
        - $ref: '#/components/parameters/MessageRecipientId'
        - $ref: '#/components/parameters/CommonSignatureHeader'
        - $ref: '#/components/parameters/CommonSignatureDateHeader'
        - $ref: '#/components/parameters/CommonSHA256Header'
        - $ref: '#/components/parameters/CommonSignatureCertifcateHeader'
      
      responses:
        '204':
            description: Publication config deleted
        '401':
            description: Unauthorised Error            

#####################

                
components:

  parameters:

    MessageChannel:
      name: id
      in: path
      required: true 
      schema:
        $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-000-InterfaceID' 

    MessageRecipientId:
      name: recipient-id
      in: path
      required: true 
      schema:
        $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-006-DIPParticipantID' 

    CommonSignatureHeader:
      name: X-DIP-Signature
      schema:
        type: string
      in: header
      required: true

    CommonSignatureDateHeader:
      name: X-DIP-Signature-Date
      schema:
        type: string
      in: header
      required: true

    CommonSHA256Header:
      name: X-DIP-Content-Hash
      schema:
        type: string
      in: header
      required: true

    CommonSignatureCertifcateHeader:
      name: X-DIP-Signature-Certificate
      schema:
        type: string
      in: header
      required: true


  securitySchemes:
    ApiKeyAuth:        # security scheme name 
      name: X-API-Key   
      type: apiKey
      in: header       

  


  schemas:

### DIP message defintion              

    DIPMessageArray:
      description: Array of DIP messages
      type: array
      minItems: 1
      items:
        $ref: '#/components/schemas/DIPMessage'
        
# Interface defintions found in interfaces file
  
    DIPMessage:
      description: DIP message - multiple payloads mapped into single object 
      type: object
      required: # DIN-784
        - payload
      properties:
        payload:
          oneOf:
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-001-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-002-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-003-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-004-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-005-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-006-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-007-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-008-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-009-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-013-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-014-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-015-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-016-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-018-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-019-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-020-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-021-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-022-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-023-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-024-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-025-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-026-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-027-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-028-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-031-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-032-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-033-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-034-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-035-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-036-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-037-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-038-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-039-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-040-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-041-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-043-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-044-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-045-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-047-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/IF-050-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-002-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-002A-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-002B-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-003-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-004-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-006-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-007-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-008-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-009-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-900-Payload'
            - $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/Interfaces-EventCodes/1.5.2#/components/schemas/REP-901-Payload'
  
  


## Config types:
  
    WebhookConfig:    #DIN-464 - updated to remove RestConfig and PublicationConfig to simplify 
      type: object
      properties:
        callbackURL:
          type: string
          format: uri
          example: https://bigEnergyServer.com/receiveEvents

        maxMessageCount:
                  description : optional - will default  - lower lmit
                  type: number
                  example: 100
        maxPayloadSize:
                  description : overall maximum payload size in Kb 
                  type: number
                  example: 100000

    MessageRequest:
      type: object
      required:
          - MPAN
#          - recipientID

      properties:
        datetimeFrom:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-003-DateTime'
        datetimeTo:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-003N-DateTime'
        eventCode:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-004N-EventCode'
        MPAN:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-002N-MPAN'
        transactionIDs:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-014-DIPTransactionID' 
#        recipientID:
#            # the indended (logical) recipient of the orginal message 
#            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-006-DIPParticipantID'


#    BulkLoadConfig:
#      type: object
#      properties:
#        maxMessageCount:
#                  description : optional - will default 
#                  type: number
#                  example: 100

# Standard reponse object from DIP on Send Event API

    StandardResponse:
      type: object
      properties:
          messageArray:
            $ref: '#/components/schemas/StandardResponseArray'
          timestamp:
            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-003-DateTime'
          
    StandardResponseArray:
      description: Submit Event API Response type
      type: array
      minItems: 1
      items:
        $ref: "#/components/schemas/StandardResponseBodyType"

    StandardResponseBodyType:
      type: object
      properties:
        transactionID:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-014-DIPTransactionID' 
        senderUniqueReference : 
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-995-SenderUniqueReference'
        correlationID:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-011-CorrelationID'

        sentTimestamp:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-003-DateTime'
        senderID :
            # the sender of this message
            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-006-DIPParticipantID'
        recipientID :
            # indended (logical) recipient of the message, i.e sender of the original event message
            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-006-DIPParticipantID'
        DIPConnectionProviderID :
            # physical recipient of the message (if different to recipient Id)
            $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-006-DIPParticipantID'
        message:
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-005N-StatusErrorMessage'
        help: 
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-019-HelpText'
        serviceTicketURL: 
          $ref: 'https://api.swaggerhub.com/domains/MHHSPROGRAMME/DataTypes/1.5.2#/components/schemas/DT-018-URL'

      required: 
        - transactionID
        - sentTimestamp
        - senderID
        - recipientID
        - message



## End ##